package retrofit2.converter.gson.adapter;

import com.google.gson.TypeAdapter;

import java.io.IOException;

/**
 * Created by kkmike999 on 16/4/23.
 */
public class GsonResponseAdapter<T> implements ResponseAdapter<T> {

	private TypeAdapter<T> adapter;

	public GsonResponseAdapter(TypeAdapter<T> adapter) {
		this.adapter = adapter;
	}

	@Override
	public T fromJson(String body) throws IOException {
		return adapter.fromJson(body);
	}
}
